class Album < ActiveRecord::Base
  has_many :songs
  validates_presence_of :name
  validates_presence_of :label
  validates_presence_of :genre
  validates_length_of :name, :within => 1..32
  validates_length_of :label, :within => 1..32
  validates_length_of :genre, :within => 1..32


  def self.search(search)
    search = "%" + search + "%"
    find(:all, :conditions => ['name LIKE ?', search])
  end
end
